<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	
%> 
<base href="<%=basePath%>">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<script type="text/javascript" src="<%=basePath%>jquery1.8/jquery-1.8.0.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>抵押贷初审2_ycl</title>
<style>
	.logo{
		background-image:url(images/hyd_logo.png);
		background-repeat:repeat-y;
		border:1px solid black;
		background-color: gray;
		width:100%;
		height:80px;
		margin:auto;
	}
	.logo h1{
		color:white;
		position:absolute; 
		font-size:30px;
		margin-left: 180px;
		margin-top: 5px;
	}
	.logo button{
		color: red;
		width:80px;
		height:30px;
		font-size:18px;
		font-weight:bold;
		float:right;
		margin-top: 45px;
	}
	.demo{
		border:2px solid green;
		width:100%;
		height: 590px;
		
	}
	.demo01{
		width:150px;
		height:590px;
		background-color:highlight;
		border:1px solid gray;
		float: left;
	}
 	.leixin{
		font-size: 18px;
		margin: 35px auto;	
	} 
 	a{	
		text-decoration:none;
		color:brown;
		font-weight: bold;
	}
 	.demo02{
		width:1420px;
		height: 590px;
		border:1px solid red;
		margin-left: 155px;
	}

 	.banquan{
		width: 100%;
		height: 70px;
		background-color: gray;
		border:1px solid black;
		
	}
	.banquan p{
		text-align: center;
		font-size: 16px;
		margin-top: 2px;
	} 
	td{
		text-align: center;
		color:maroon;
		font-weight: bold;
	}
	tr{
		line-height: 25px;
	} 
	#img{
		border:0px solid red;
		width: 600px;
		height: 500px;
		margin-left: 720px;
		margin-top: -540px;
	}
	.yema{
		border:0px solid red;
		width: 400px;
		height: 20px;
		margin: auto;
		margin-top: 30px;
		color: brown;
		font-weight: bold;
	}
	.isno{
		position: absolute;
		border:0px solid red;
		width: 550px;
		height: 240px;
		margin-left: 300px;
		margin-top: -400px;
	}
	.whitPinglun{
		position: absolute;
		border:2px solid gray;
		width: 400px;
		height: 220px;
		margin-left: -340px;
		margin-top: -240px;
	}
</style>
</head>
<body>
	<!-- logo区 -->
	<div class="logo" >	
		<h1>好易贷初审管理系统</h1>
		<button onclick="out()">退出</button>
	</div>
	<!-- 内容区 -->
	<div class="demo" >
		<!-- 模块1区 -->
		<div class="demo01">
			<ul class="type">
				<li class="leixin"><a href="<%=basePath%>ApplyAction/applyList.do">信用贷款</a></li>
				<li class="leixin"><a href="<%=basePath%>ApplyAction/applyList3.do">公司贷款</a></li>
			</ul>
		</div>
		<!-- 模块2区 -->
		<div class="demo02">			
			<p style="color:brown;font-weight: bold;font-family: cursive;font-size: 20px;margin-top: -1px">抵押贷款用户</p>
			<form action="<%=basePath%>ApplyAction/applyList2.do" method="post" id="pageForm">
				<input type="hidden" id="pageNum" value="${pageF.pageNum }" name="pageNum"/>
				<input type="hidden" id="totalPage" value="${pageF.totalPage }"/>
				<c:forEach items="${applyList }" var="news" varStatus="st">
					<table border="1" bordercolor="brown" style="margin-left: 50px;">
						<tr>
							<td width="150px">编号</td><td width="400px">${st.index+1 }</td>
						</tr>
						<tr>
							<td>单号</td><td>${news.pay_num }</td>
						</tr>
						<tr>
							<td>姓名</td><td>${news.app_name }</td>
						</tr>
						<tr>
							<td>电话</td><td>${news.app_phone }</td>
						</tr>
						<tr>
							<td>身份证</td><td>${news.idcard_num }</td>
						</tr>
						<tr>
							<td>银行卡</td><td>${news.bank_num }</td>
						</tr>
						<tr>
							<td>现居地址</td><td>${news.app_address }</td>
						</tr>
						<tr>
							<td>贷款金额</td><td>${news.daik_money }</td>
						</tr>
						<tr>
							<td>贷款用途</td><td>${news.daik_use }</td>
						</tr>
						<tr>
							<td>婚姻状况</td><td>${news.mar_state }</td>
						</tr>
						<tr>
							<td>公司名称</td><td>${news.company_name }</td>
						</tr>
						<tr>
							<td>公司地址</td><td>${news.company_add }</td>
						</tr>
						<tr>
							<td>紧急联系人</td><td>${news.con_name }</td>
						</tr>
						<tr>
							<td>贷款类型</td><td>${news.product.pro_combo_name }<button type="button" onclick="diya()" style="margin-left: 20px;color:blue;">查看抵押证明</button></td>
						</tr>
						<tr>
							<td>贷款期数</td><td>${news.fenqi.fname }</td>
						</tr>
						<tr>
							<td>紧急联系人电话</td><td>${news.con_phone }</td>
						</tr>
						<tr>
							<c:choose>
							   <c:when test="${news.s_id eq 2 }">  
					     			<td colspan="2"><button style="width: 500px;height: 35px;color:green;font-size: 20px;font-weight: bold;">初 审 通 过 ✔</button></td>
							   </c:when>
							   <c:when test="${news.s_id eq 4 }">  
					     			<td colspan="2"><button style="width: 500px;height: 35px;color:red;font-size: 20px;font-weight: bold;">已 驳 回 ✘</button></td>
							   </c:when>
							   <c:otherwise> 
									<td height="35px;">审核意见</td><td><input type="button" value="通过" onclick="ok('${news.pay_num }')" style="width: 100px;height: 30px;color:green;font-size: 17px;font-weight: bold;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="驳回" onclick="no('${news.pay_num }')" style="width: 100px;height: 30px;color:red;font-size: 17px;font-weight: bold;"/></td>	
							   </c:otherwise>
							</c:choose>
						</tr>	 
					</table>
					
					
					<!-- 图片分页区 -->
					<div id="img">
					
						<c:forEach items="${imgtabList }" var="tab" varStatus="ta">
						<c:if test="${tab.pay_num eq news.pay_num }">
						<c:choose>
						  	<c:when test="${tab.pay_num eq news.pay_num }">
					  	  		<table border="1" bordercolor="green" >
									<tr>
										<td colspan="2" height="35px">身份证正反面</td>
									</tr>
									<tr>
										<td width="290px" height="160px"><img src="img/${tab.frIDC }" width="288px" height="158px"></td><td width="290px" height="160px"><img src="img/${tab.reidc }" width="288px" height="158px"></td>
									</tr>
									<tr>
										<td colspan="2" height="35px">银行卡正反面</td>
									</tr>
									<tr>
										<td width="290px" height="160px"><img src="img/${tab.frbank }" width="288px" height="158px"></td><td width="290px" height="160px"><img src="img/${tab.rebank }" width="288px" height="158px"></td>
									</tr>
								</table>
						   	</c:when>
							
							<c:otherwise> 
								<table border="1" bordercolor="green" >
									<tr>
										<td colspan="2" height="35px">身份证正反面</td>
									</tr>
									<tr>
										<td width="290px" height="160px"><img src="img/999.jpg" width="288px" height="158px"></td><td width="290px" height="160px"><img src="img/999.jpg" width="288px" height="158px"></td>
									</tr>
									<tr>
										<td colspan="2" height="35px">银行卡正反面</td>
									</tr>
									<tr>
										<td  width="290px" height="160px"><img src="img/999.jpg" width="288px" height="158px"></td><td width="290px" height="160px"><img src="img/999.jpg" width="288px" height="158px"></td>
									</tr>
								</table>
							</c:otherwise>
						</c:choose>	
						
						<!-- 抵押证明 -->	
						<div class="whitPinglun" style="display: none;">
							<c:choose>
							  	<c:when test="${not empty tab.diyimg }">
									<img src="img/${tab.diyimg }" width="400px" height="220px">
								</c:when>
								<c:otherwise>
									<img src="img/999.jpg" width="400px" height="220px">
								</c:otherwise>
							</c:choose>
						</div>
						
						</c:if>
						
						</c:forEach>
						<div class="yema">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前是第${pageF.pageNum }/${pageF.totalPage }页,一共有${pageF.totalNum }条数据<br/>	<br/>	
							&nbsp;&nbsp;&nbsp;&nbsp;
							<button><a href="javascript:firstPage()">首页</a></button>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<button><a href="javascript:upPage()">上一页</a></button>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<button><a href="javascript:nextPage()">下一页</a></button>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<button><a href="javascript:lasPage()">尾页</a></button>
						</div>
					</div>
					
				</c:forEach>	
			</form>
		<div class="isno" ></div>
		
		

			
		</div>
	</div>
	<!-- 版权区 -->
	<div class="banquan">
		<p>版权所有，盗版必究</p>
		<p>http://www.zhiling.com</p>
	</div>
<script type="text/javascript">

		function firstPage(){
			document.getElementById("pageNum").value=1;
			document.getElementById("pageForm").submit();
		}
		
		function upPage(){
			var pageNum = document.getElementById("pageNum").value;
			pageNum = parseInt(pageNum);
			if(pageNum <= 1){
				alert("当前已经是第一页了");
			}
			else{
				pageNum = pageNum - 1;
				document.getElementById("pageNum").value=pageNum;
				document.getElementById("pageForm").submit();
			}
		}
		
		function nextPage(){
			var pageNum = document.getElementById("pageNum").value;
			
			var totalPage = document.getElementById("totalPage").value;
			pageNum = parseInt(pageNum);
			totalPage = parseInt(totalPage);
			if(pageNum >= totalPage){
				alert("当前已经是最后一页了");
			}
			else{
				pageNum = pageNum + 1;
				document.getElementById("pageNum").value=pageNum;
				document.getElementById("pageForm").submit();
			}
		}
		
		function lasPage(){
			var totalPage = document.getElementById("totalPage").value;
			document.getElementById("pageNum").value=totalPage;
			document.getElementById("pageForm").submit();
		}
		
		function ok(a){
			var b = document.getElementById("pageNum").value;
			location.href="<%=basePath%>ApplyAction/applyApprove.do?pay_num="+a+"&sur_content="+b;
			alert("初审已通过!");
		}
		
		function no(a){
			var b = document.getElementById("pageNum").value;
			location.href="<%=basePath%>ApplyAction/applyNoApprove.do?pay_num="+a+"&sur_content="+b;
			alert("初审已驳回!");
		}
		
		function out(){
			alert("退出登录主界面");
			<%-- location.href="<%=basePath%>BookConterller/queryDept.do"; --%>
		}
		function diya(){
			if($(".whitPinglun").is(":hidden")){  
		         $(".whitPinglun").show();  
		    }else{  
		         $(".whitPinglun").hide();       
		    }	  
		}
		
		<%--
		function qerOperation(){
			location.href="<%=basePath%>BookConterller/queryOperation.do";
		} --%>
		
</script>
</body>
</html>